package com.example.Pojo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;   //响应码
    private String mgs;     //响应信息 描述字符串的
    private Object data;    //返回的数据

    //响应成功
    public static Result success() {
        return new Result(1, "success", null);
    }

    //响应成功
    public static Result success(Object data) {
        return new Result(1, "success", data);
    }

    //响应失败
    public static Result error(String mgs) {
        return new Result(0, mgs, null);
    }
}
